The present invention relates generally to software development and more specifically to various aspects of language development within any of various programming languages, such as a platform-independent, object-oriented programming language, as one example.
Many programming languages support parametric polymorphism, such as generic classes in Java, C# and Scala. Generic classes are often written with assumptions about the domain of genericity. Frequently such assumptions are explicit within the programming language, while other assumptions are implicit. For example, within the Java programming language generic classes have traditionally been written assuming that type variables range over reference types only. These assumptions are often integral to the implementation of these classes. For instance, for a generic class with the declaration, List<T>, developers may write code with the assumption T must be a reference type. However, the assumptions about the restricted domain make the ability to generify over a broader domain, such as one including both reference and primitive types, more difficult or problematic.